package com.app.mycomposedemo.viewmodel

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Description
import androidx.compose.material.icons.filled.SmartDisplay
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import com.app.mycomposedemo.data.TabCategoryData
import com.app.mycomposedemo.data.TabTypeData


class MainViewModel : ViewModel() {
    // 分类标签
    val categories: List<TabCategoryData> = mutableListOf(
        TabCategoryData("思想政治"),
        TabCategoryData("法律法规"),
        TabCategoryData("职业道德"),
        TabCategoryData("诚信自律")
    )

    // 当前分类下标
    var categoryIndex: Int by mutableStateOf(0)

    // 更新当前分类下标
    fun updateCategoryIndex(index: Int) {
        categoryIndex = index
    }

    // 类型标签
    val types: List<TabTypeData> = mutableListOf(
        TabTypeData("相关咨询", Icons.Default.Description),
        TabTypeData("视频课程", Icons.Default.SmartDisplay)
    )

    // 当前类型下标
    var typeIndex: Int by mutableStateOf(0)

    // 更新当前类型下表
    fun updateTypeIndex(index: Int) {
        typeIndex = index
    }

    // 垂直轮播图内容
    val verticalTexts = mutableListOf(
        "人社部向疫情防控期",
        "湖北黄冈新冠肺炎患者治愈病例破千连续5治愈病例破千连续5",
        "安徽单日新增确诊病例首次降至个位数累计"
    )
}